/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef CAPS_NOTIFICATION_H
#define CAPS_NOTIFICATION_H

#include <core/notification.h>
#include <caps/capability.h>

static inline notification_t *cap_ntfn_get_obj(capability_t *cap)
{
    /* PRQA S 0306 1 # interger/point cast */
    return (notification_t *)cap_get_long_info(cap);
}

static inline int cap_ntfn_put(capability_t *cap)
{
    return notification_put(cap_ntfn_get_obj(cap));
}

void cap_ntfn_init(capability_t *cap, notification_t *obj);

void cap_ntfn_dispatcher(capability_t *cap, unsigned long tag, unsigned long m0, unsigned long m1, unsigned long m2,
                         unsigned long m3, unsigned long m4, unsigned long m5);

#endif
